package com.study.demo.gsbean.demo5;

import org.joda.time.DateTime;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author: elvin
 * @time: 2019-04-18 15:54
 * @desc:
 **/
public class User  {

    private String dateFormat="";

    private String name;

    private  int age;

    private Date birthday;

    private List<String> books;


    public String getDateFormat() {
        return dateFormat;
    }

    public void setDateFormat(String dateFormat) {
        this.dateFormat = dateFormat;
    }

    public User() {
    }

    public User(String name, int age, Date birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }

    public User(int age, String  name) {
        this.age = age;
        this.name = name;
        this.birthday = new DateTime("2020-02-02").toDate() ;
    }

    public User(String name, int age) {
        this.name = name;
        this.age = age;
        this.birthday = new DateTime("2000-01-01").toDate() ;
    }


    public User(String name, Date birthday) {
        this.name = name;
        this.birthday = birthday;
    }

    public User(Date birthday, String name, int age,  List<String> books) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
        this.books = books;
    }


    @Override
    public String toString() {
        SimpleDateFormat format   =   new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", birthday='" + format.format(birthday) + '\'' +
                ", books=" + books +
                '}';
    }
}
